#!/usr/bin/env python
# -*- coding: utf-8 -*-

""" By Martin Senande-Rivera
    For Towards and atmosphere more favourable to firestorm development in Europe """

import os
import glob, sys
import numpy as np
import xarray as xr
import pandas as pd

path_dmp='./0-DATA/'

# Read files
DMP = xr.open_dataset(path_dmp+'DMP_mean.nc')['DMP']
DMP.values[DMP.values==-0.02]=np.nan
DMP.values[DMP.values==0.]=np.nan

# Number of years required for the accumulation of 6 kg m-2 of fuel load according to the average annual dry matter productivity (DMP) kg day-1 ha-1
YEARS6 = 6./(DMP*365./10000.)
YEARS6.to_netcdf('Years_fuelload6.nc')  # Save output
